Ext.define('DragonApp.view.white.IPForm', {
    extend: 'Ext.window.Window',
    alias: 'widget.ipform',

    layout: 'center',

    closable: true,
    modal: true,
    height: 230,
    width: 400,
    items: [{
        modelValidation: true,
        itemId: 'ip_form',
        xtype: 'form',
        padding: 10,
        layout: {
            type: 'fit',
            align: 'stretch'
        },
        items: [{
            xtype: 'fieldset',
            width: 380,
            title: '白名单信息',
            layout: 'anchor',
            padding: '15 20 15 20',
            defaults: {
                afterLabelTextTpl: DragonApp.util.String.required,
                anchor: '100%',
                xtype: 'textfield',
                msgTarget: 'side',
                labelWidth: 85
            },
            items: [{
                name: 'id',
                fieldLabel: '白名单ID',
                xtype: 'hiddenfield'
            }, {
                fieldLabel: 'IP段起始',
                vtype: 'IPAddress',
                allowBlank: false,
                name: 'ip_from'
            }, {
                fieldLabel: 'IP段终止',
                vtype: 'IPAddress',
                allowBlank: false,
                name: 'ip_end'
            }, {
                fieldLabel: '适用服务器',
                xtype: 'multiservercombo',
                allowBlank: false,
                name: 'server'
            }, {
                xtype: 'hiddenfield',
                fieldLabel: '类型',
                name: 'type',
                value: 'ip'
            }]
        }]
    }],
    dockedItems: [{
        xtype: 'toolbar',
        dock: 'bottom',
        ui: 'footer',
        layout: {
            pack: 'end',
            type: 'hbox'
        },
        items: [{
            xtype: 'button',
            text: '取消',
            itemId: 'canclebtn_ipform',
            iconCls: 'x-fa fa-times',
            handler: 'onCancel'
        }, {
            xtype: 'button',
            text: '保存',
            itemId: 'savebtn_ipform',
            iconCls: 'x-fa fa-check',
            handler: 'onSave'
        }]
    }]
});